package demo2;

class Animal{
    public String name;
    public int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }
//    public Animal(){
//
//    }

    public void eat(){
        System.out.println(name + "正在吃东西......");
    }
}

class Dog extends Animal{
    public Dog(String name,int age){
        super(name,age);
    }

    public void bark(){
        System.out.println(name + "正在汪汪叫......");
    }

//    public Dog(){
//        super();
//    }
}

class Bird extends Animal{
    public Bird(String name,int age){
        super(name,age);
    }

//    public Bird(){
//        super("鹏鹏",1);
//    }

    public void fly(){
        System.out.println(name + "正在飞......");
    }

}

public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog("德芙",1);
        Bird bird = new Bird("鹏鹏",2);
        dog.eat();
        dog.bark();
        bird.eat();
        bird.fly();
    }
}
